#include "stack.h"
int  init_stack(DirStack *stack) {
    stack->top = -1;
    return 0;
}

int  push(DirStack *stack, int id) {
    if (stack->top >= MAX_DEPTH - 1) return -1;
    stack->top++;
    stack->dirs[stack->top]=id;
    return 0;
}

int  pop(DirStack *stack) {
    if (stack->top <=0) return -1;
    stack->top--;
    return 0;
}
int get_top(DirStack *stack,int *id){
    *id=stack->dirs[stack->top];
    return 0;
}



